import time
from lib.api import iot
from lib.sensors.person import ld2420

person = ld2420.Person()

while True:
    try:
        has_person = person.get_data()
        print(has_person)
        iot.upload_data({"has_person": has_person}, "Tiot_bba1471x")
        time.sleep(8)
    except Exception as e:
        print(e)
